I'm trying to inject a content script into google-maps page using the below code for extracting some info
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
var tab = tabs[0];
chrome.scripting.executeScript({
target: { tabId: tab.id, allFrames: false },
files: ['page.js'],
}).then(() => {
// Doing some stuff
});
});
For example this URL: https://www.google.com/maps/contrib/117085129581545773137/reviews/@40.490946,-75.2538051,8z/data=!3m1!4b1!4m3!8m2!3m1!1e1
always getting this error message: Uncaught (in promise) Error: This page cannot be scripted due to an ExtensionsSettings policy.
manifest.json file
{
"name": "Extension",
"version": "1.0",
"manifest_version": 3,
"action": {
"default_title": "Click to view a popup",
"default_popup": "index.html"
},
"permissions": [
"activeTab",
"scripting",
"storage",
"unlimitedStorage",
"tabs"
],
"icons": {
"16": "images/icon16-999.png",
"48": "images/icon48-999.png",
"128": "images/icon128-999.png"
}
}
However other sites it's working fine.